home *** CD-ROM | disk | FTP | other *** search
- head 1.4;
- branch ;
- access ;
- symbols ;
- locks shirriff:1.4; strict;
- comment @# @;
-
-
- 1.4
- date 92.04.23.12.33.00; author shirriff; state Exp;
- branches ;
- next 1.3;
-
- 1.3
- date 92.04.23.12.13.40; author jhh; state Exp;
- branches ;
- next 1.2;
-
- 1.2
- date 89.11.27.10.56.04; author shirriff; state Exp;
- branches ;
- next 1.1;
-
- 1.1
- date 89.08.16.17.14.20; author shirriff; state Exp;
- branches ;
- next ;
-
-
- desc
- @Initial program.
- @
-
-
- 1.4
- log
- @Changed it to kill all debug processes if you're root.
- @
- text
- @#! /sprite/cmds/perl
- #
- # This is a Perl script that kills off all processes in the DEBUG state.
- #
- # $Header: /sprite/lib/forms/RCS/proto.csh,v 1.3 90/02/20 17:10:35 douglis Exp $ SPRITE (Berkeley)
- #
- # Copyright 1990 Regents of the University of California
- # Permission to use, copy, modify, and distribute this
- # software and its documentation for any purpose and without
- # fee is hereby granted, provided that the above copyright
- # notice appear in all copies. The University of California
- # makes no representations about the suitability of this
- # software for any purpose. It is provided "as is" without
- # express or implied warranty.
- #
- #
-
- #
- # See if we're root
- #
- $user = `whoami`;
- chop($user);
-
- #
- # Read output of "ps -d".
- #
- if ($user eq "root") {
- open(input, "ps -ad |") || print("Open failed: $!\n");
- } else {
- open(input, "ps -d |") || print("Open failed: $!\n");
- }
-
- #
- # Get rid of header.
- #
- <input>;
-
-
- while(<input>) {
- ($f1) = split(' ');
- $goners[$#goners + 1] = hex($f1);
- $pids[$#pids + 1] = $f1;
- }
-
- if ($#goners >= 0) {
- printf("%s\n", join(' ', @@pids));
- #
- # Give them a chance to die nicely.
- #
- kill ("TERM", @@goners) || print("Kill failed: $!\n");
- #
- # Finish them off.
- #
- kill ("KILL", @@goners) || print("Kill failed: $!\n");
- }
- @
-
-
- 1.3
- log
- @(Checked in by shirriff)
- @
- text
- @d19 6
- d27 5
- a31 1
- open(input, "ps -d |") || print("Open failed: $!\n");
- @
-
-
- 1.2
- log
- @Fixed bug preventing processes with pids < 5 digits being killed.
- @
- text
- @d1 45
- a45 6
- #! /bin/csh -f
- # This is a script to kill any processes in the debugger
- # Ken Shirriff Aug/89
- set i = ( `ps -d | tail +2 | sed -e "s/^ *//" | sed -e "s/ *//" | sed -e "s/ .*//" `)
- echo $i
- kill -KILL $i >& /dev/null
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d4 1
- a4 1
- set i = ( `ps -d | tail +2 | sed -e "s/ *//" | sed -e "s/ .*//" `)
- @
-